<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Вход: Mода от Индия</title>
	<style type="text/css">
		.inputComment{
			color:blue;
		}
	
	</style>
	<script src="jquery-2.1.1.min.js"> </script>
	<script>
	$(document).ready(function(){
		$("input").focus(function(){
			$(this).css("background-color","yellow")
		})
		$("input").blur(function(){
			$(this).css("background-color","white")
		})
	})
	</script>
	
	<script> 
		function Login(){
			var warnings = false;
			var username= $("#username").val();
			if(!username){
				$("#usernameComment").html("Въведете име");
				warnings=true;
			}
	
			var password = $("#password").val();
			if(!password){
				$("#passwordComment").html("Въведете парола");
				warnings=true;
			}
			if(!warnings){
				$.post("Login",{username:username,password:password},function(data){
						if(data=='No such user'){
							$("#comment").html("Потребителското име или парола са невалидни!");
						}else window.location=data;
					});
			}
		}
	</script>
</head>
<body>
Вход или регистрация <a href="Registration.html"> тук </a>
<form autocomplete="off">
<table>
<tr>
	<td>Потребител:</td> <td><input id="username" type="text" name="username" > </td>
	<td id="usernameComment" class="inputComment"> </td>
</tr>
<tr>
	<td>Парола: </td> <td> <input id="password" type="password" name="password" > </td>
	<td id="passwordComment" class="inputComment"> </td>
</tr>
<tr> <td> <button type="button" onclick="Login()"> Вход</button> </td> </tr> 
</table>
</form>
<div id="comment" style="color: red">  </div>
</body>
</html>